package www.openteam.com.model.PrdctnMngmnt;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import www.openteam.com.base.BaseModel;
import www.openteam.com.bean.OutFactoryMsg;

/**
 * Created by Administrator on 2019-06-17.
 */

public class SendRCkSearchModel extends BaseModel {

    public void findOutFactoryMsg( final OutFactoryListener listener){
        httpApiService.findOutFactoryMesg().subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber<OutFactoryMsg>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {
                        listener.fail(e);
                    }

                    @Override
                    public void onNext(OutFactoryMsg data) {
                        listener.success(data);
                    }
                })
        ;
    }

    public interface OutFactoryListener{
        void success(OutFactoryMsg outFactoryMsg);

        void fail(Throwable e);
    }
}
